package com.carp.springframework.processor;

import com.carp.springframework.beans.PropertyValues;
import com.carp.springframework.beans.factory.config.BeanDefinition;
import com.carp.springframework.beans.factory.config.BeanFactoryPostProcessor;
import com.carp.springframework.beans.factory.config.ConfigurableListableBeanFactory;

/**
 * @author lile
 * @date 2023/2/17
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();
        propertyValues.addPropertyValue("company", "西瓜公司(改)");
    }
}
